This chapter is a general introduction to file management on Macintosh computers. It explains the basic structure of Macintosh files and the hierarchical file system (HFS) used with Macintosh computers, and it shows how you can use the services provided by the Standard File Package, the File Manager, the Finder, and other system software components to create, open, update, and close files.
You should read this chapter if your application implements the commands typically found in an application's File menu--except for printing commands and the Quit command, which are described elsewhere. This chapter describes how to
Depending on the requirements of your application, you may be able to accomplish all your file-related operations by following the instructions given in this chapter. If your application has more specialized file management needs, you'll need to read some or all of the remaining chapters in this book.
This chapter assumes that your application is running in an environment in which the routines that accept file system specification records (defined by the FSSpec data type) are available. File system specification records, introduced in system software version 7.0, simplify the identification of objects in the file system. Your development environment may provide "glue" that allows you to call those routines in earlier system software versions. If such glue is not available and you want your application to run in system software versions earlier than version 7.0, you need to read the discussion of HFS file-manipulation routines in the chapter "File Manager" in this book.
This chapter begins with a description of files and their organization into directories and volumes. Then it describes how to test for the presence of the routines that accept FSSpec records and how to use those routines to perform the file management tasks listed above. The chapter ends with descriptions of the data structures and routines used to perform these tasks.